package com.prs.crm.service.oa.impl;

import java.io.File;

import com.prs.crm.context.Attach;
import com.prs.crm.context.Constrains;
import com.prs.crm.context.FileUtil;
import com.prs.crm.dao.oa.ApplyAuditDao;
import com.prs.crm.domain.oa.ApplyAudit;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.oa.ApplyAuditService;

public class ApplyAuditServiceImpl extends BaseServiceImpl<ApplyAudit,ApplyAuditDao> implements ApplyAuditService{

	@Override
	public void saveApplyAudit(ApplyAudit applyAudit, File file, String fileName) {
		// TODO Auto-generated method stub
		Attach attach = FileUtil.getInstance().saveFile(file, fileName, "", Constrains.UPLOAD_DIC_APPLY);
		if(attach.getSrc() != null) {
			applyAudit.setAttach(attach.getSrc());
		}
		this.getDao().save(applyAudit);
	}

}
